home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / ms-0.07 / lib / mspawn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-27  |  2.0 KB  |  63 lines

  1. /* mspawn.h - define X-independent MandelSpawn state */
  2.    
  3. #ifndef _mspawn_h
  4. #define _mspawn_h
  5.  
  6. #include "ms_job.h"  /* for struct static_job_info, etc. */
  7. #include "ms_real.h" /* for "complex" declaration */
  8.  
  9. /*
  10.   We must #undef at least the old ABS definition because
  11.   on OSF/1 ABS is defined as 1 (!) by <X11/Xos.h>.
  12. */
  13.  
  14. #ifdef MIN
  15. #undef MIN
  16. #endif
  17. #define MIN(x,y) ((x) < (y) ? (x) : (y))
  18. #ifdef MAX
  19. #undef MAX
  20. #endif
  21. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  22. #ifdef ABS
  23. #undef ABS
  24. #endif
  25. #define ABS(x) ((x) < 0 ? -(x) : (x))
  26.  
  27. /* This is what is stored in the client_data field in the chunk; */
  28. /* basically this contains all the information that is needed to */
  29. /* know what to do when a reply returns from a slave */
  30. typedef struct
  31. { unsigned int configuration;    /* used to check for obsolete replies */
  32.   ms_rectangle s;        /* rectangle being updated */
  33. } ms_client_info;
  34.  
  35. typedef struct ms_state
  36. { char *client;            /* back pointer to client object (Ms/bms) */
  37.   unsigned height;
  38.   unsigned width;
  39.   double center_x;        /* x coord. of view center */
  40.   double center_y;        /* y coord. of view center */
  41.   double xrange;        /* real axis interval */
  42.   double yrange;        /* imaginary axis interval */
  43.   int julia;            /* Julia set mode (used as a Bool by Ms.c) */
  44.   double c_x;            /* c value for Julia set only, real part */
  45.   double c_y;            /*   imaginary part */
  46.   unsigned long mi_count;    /* total no. of iterations done */
  47.   struct static_job_info job;    /* buffer for data passed to the slave */
  48.   unsigned bytes_per_count;    /* number of bytes in iteration count */
  49.   unsigned chunks_out;        /* number of chunks being calculated */
  50.   unsigned configuration;    /* serial no. of current setup */
  51.   unsigned chunk_height;    /* height of pixel block */
  52.   unsigned chunk_width;        /* width of pixel block */
  53.   struct wf_state *workforce;    /* pointer to workforce data */
  54.   int show_interior;        /* flag: display interior structure */
  55. } ms_state;
  56.  
  57. void ms_init();
  58. void ms_calculate_job_parameters();
  59. void ms_dispatch_chunk();
  60. void ms_dispatch_rect();
  61.  
  62. #endif /* _mspawn_h */
  63.